<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Class template basic_managed_xsi_shared_memory</title>
<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../../interprocess/indexes_reference.html#header.boost.interprocess.managed_xsi_shared_memory_hpp" title="Header &lt;boost/interprocess/managed_xsi_shared_memory.hpp&gt;">
<link rel="prev" href="wmanaged_windows__idm27454.html" title="Type definition wmanaged_windows_shared_memory">
<link rel="next" href="managed_xsi_shared_memory.html" title="Type definition managed_xsi_shared_memory">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
<td align="center"><a href="../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="wmanaged_windows__idm27454.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../interprocess/indexes_reference.html#header.boost.interprocess.managed_xsi_shared_memory_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="managed_xsi_shared_memory.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="boost.interprocess.basic_managed_xsi_idm27466"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template basic_managed_xsi_shared_memory</span></h2>
<p>boost::interprocess::basic_managed_xsi_shared_memory</p>
</div>
<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../../interprocess/indexes_reference.html#header.boost.interprocess.managed_xsi_shared_memory_hpp" title="Header &lt;boost/interprocess/managed_xsi_shared_memory.hpp&gt;">boost/interprocess/managed_xsi_shared_memory.hpp</a>&gt;

</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> CharType<span class="special">,</span> <span class="keyword">typename</span> AllocationAlgorithm<span class="special">,</span> 
         <span class="keyword">template</span><span class="special">&lt;</span> <span class="keyword">class</span> <span class="identifier">IndexConfig</span> <span class="special">&gt;</span> <span class="keyword">class</span> IndexType<span class="special">&gt;</span> 
<span class="keyword">class</span> <a class="link" href="basic_managed_xsi_idm27466.html" title="Class template basic_managed_xsi_shared_memory">basic_managed_xsi_shared_memory</a> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
  <span class="comment">// types</span>
  <span class="keyword">typedef</span> <span class="identifier">base_t</span><span class="special">::</span><span class="identifier">size_type</span> <a name="boost.interprocess.basic_managed_xsi_idm27466.size_type"></a><span class="identifier">size_type</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="basic_managed_xsi_idm27466.html#boost.interprocess.basic_managed_xsi_idm27466construct-copy-destruct">construct/copy/destruct</a></span>
  <a class="link" href="basic_managed_xsi_idm27466.html#idm27489-bb"><span class="identifier">basic_managed_xsi_shared_memory</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <a class="link" href="basic_managed_xsi_idm27466.html#idm27492-bb"><span class="identifier">basic_managed_xsi_shared_memory</span></a><span class="special">(</span><a class="link" href="create_only_t.html" title="Struct create_only_t">create_only_t</a><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="xsi_key.html" title="Class xsi_key">xsi_key</a> <span class="special">&amp;</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">,</span> 
                                  <span class="keyword">const</span> <span class="keyword">void</span> <span class="special">*</span> <span class="special">=</span> <span class="number">0</span><span class="special">,</span> 
                                  <span class="keyword">const</span> <a class="link" href="permissions.html" title="Class permissions">permissions</a> <span class="special">&amp;</span> <span class="special">=</span> <a class="link" href="permissions.html" title="Class permissions">permissions</a><span class="special">(</span><span class="special">)</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="basic_managed_xsi_idm27466.html#idm27511-bb"><span class="identifier">basic_managed_xsi_shared_memory</span></a><span class="special">(</span><a class="link" href="open_or_create_t.html" title="Struct open_or_create_t">open_or_create_t</a><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="xsi_key.html" title="Class xsi_key">xsi_key</a> <span class="special">&amp;</span><span class="special">,</span> 
                                  <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">,</span> <span class="keyword">const</span> <span class="keyword">void</span> <span class="special">*</span> <span class="special">=</span> <span class="number">0</span><span class="special">,</span> 
                                  <span class="keyword">const</span> <a class="link" href="permissions.html" title="Class permissions">permissions</a> <span class="special">&amp;</span> <span class="special">=</span> <a class="link" href="permissions.html" title="Class permissions">permissions</a><span class="special">(</span><span class="special">)</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="basic_managed_xsi_idm27466.html#idm27530-bb"><span class="identifier">basic_managed_xsi_shared_memory</span></a><span class="special">(</span><a class="link" href="open_read_only_t.html" title="Struct open_read_only_t">open_read_only_t</a><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="xsi_key.html" title="Class xsi_key">xsi_key</a> <span class="special">&amp;</span><span class="special">,</span> 
                                  <span class="keyword">const</span> <span class="keyword">void</span> <span class="special">*</span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="basic_managed_xsi_idm27466.html#idm27542-bb"><span class="identifier">basic_managed_xsi_shared_memory</span></a><span class="special">(</span><a class="link" href="open_only_t.html" title="Struct open_only_t">open_only_t</a><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="xsi_key.html" title="Class xsi_key">xsi_key</a> <span class="special">&amp;</span><span class="special">,</span> 
                                  <span class="keyword">const</span> <span class="keyword">void</span> <span class="special">*</span> <span class="special">=</span> <span class="number">0</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="basic_managed_xsi_idm27466.html#idm27554-bb"><span class="identifier">basic_managed_xsi_shared_memory</span></a><span class="special">(</span><a class="link" href="basic_managed_xsi_idm27466.html" title="Class template basic_managed_xsi_shared_memory">basic_managed_xsi_shared_memory</a> <span class="special">&amp;&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <a class="link" href="basic_managed_xsi_idm27466.html" title="Class template basic_managed_xsi_shared_memory">basic_managed_xsi_shared_memory</a> <span class="special">&amp;</span> 
  <a class="link" href="basic_managed_xsi_idm27466.html#idm27560-bb"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><a class="link" href="basic_managed_xsi_idm27466.html" title="Class template basic_managed_xsi_shared_memory">basic_managed_xsi_shared_memory</a> <span class="special">&amp;&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <a class="link" href="basic_managed_xsi_idm27466.html#idm27486-bb"><span class="special">~</span><span class="identifier">basic_managed_xsi_shared_memory</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="basic_managed_xsi_idm27466.html#idm27476-bb">public member functions</a></span>
  <span class="keyword">void</span> <a class="link" href="basic_managed_xsi_idm27466.html#idm27477-bb"><span class="identifier">swap</span></a><span class="special">(</span><a class="link" href="basic_managed_xsi_idm27466.html" title="Class template basic_managed_xsi_shared_memory">basic_managed_xsi_shared_memory</a> <span class="special">&amp;</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
  <span class="keyword">int</span> <a class="link" href="basic_managed_xsi_idm27466.html#idm27484-bb"><span class="identifier">get_shmid</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="basic_managed_xsi_idm27466.html#idm27568-bb">public static functions</a></span>
  <span class="keyword">static</span> <span class="keyword">bool</span> <a class="link" href="basic_managed_xsi_idm27466.html#idm27569-bb"><span class="identifier">remove</span></a><span class="special">(</span><span class="keyword">int</span><span class="special">)</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="id-1.3.19.17.3.40.3.4"></a><h2>Description</h2>
<p>A basic X/Open System Interface (XSI) shared memory named object creation class. Initializes the shared memory segment. Inherits all basic functionality from basic_managed_memory_impl&lt;CharType, AllocationAlgorithm, IndexType&gt; </p>
<div class="refsect2">
<a name="id-1.3.19.17.3.40.3.4.3"></a><h3>
<a name="boost.interprocess.basic_managed_xsi_idm27466construct-copy-destruct"></a><code class="computeroutput">basic_managed_xsi_shared_memory</code> 
        public
       construct/copy/destruct</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><a name="idm27489-bb"></a><span class="identifier">basic_managed_xsi_shared_memory</span><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p>Default constructor. Does nothing. Useful in combination with move semantics </p>
</li>
<li class="listitem">
<pre class="literallayout"><a name="idm27492-bb"></a><span class="identifier">basic_managed_xsi_shared_memory</span><span class="special">(</span><a class="link" href="create_only_t.html" title="Struct create_only_t">create_only_t</a><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="xsi_key.html" title="Class xsi_key">xsi_key</a> <span class="special">&amp;</span> key<span class="special">,</span> 
                                <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> size<span class="special">,</span> <span class="keyword">const</span> <span class="keyword">void</span> <span class="special">*</span> addr <span class="special">=</span> <span class="number">0</span><span class="special">,</span> 
                                <span class="keyword">const</span> <a class="link" href="permissions.html" title="Class permissions">permissions</a> <span class="special">&amp;</span> perm <span class="special">=</span> <a class="link" href="permissions.html" title="Class permissions">permissions</a><span class="special">(</span><span class="special">)</span><span class="special">)</span><span class="special">;</span></pre>
<p>Creates shared memory and creates and places the segment manager. This can throw. </p>
</li>
<li class="listitem">
<pre class="literallayout"><a name="idm27511-bb"></a><span class="identifier">basic_managed_xsi_shared_memory</span><span class="special">(</span><a class="link" href="open_or_create_t.html" title="Struct open_or_create_t">open_or_create_t</a><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="xsi_key.html" title="Class xsi_key">xsi_key</a> <span class="special">&amp;</span> key<span class="special">,</span> 
                                <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> size<span class="special">,</span> <span class="keyword">const</span> <span class="keyword">void</span> <span class="special">*</span> addr <span class="special">=</span> <span class="number">0</span><span class="special">,</span> 
                                <span class="keyword">const</span> <a class="link" href="permissions.html" title="Class permissions">permissions</a> <span class="special">&amp;</span> perm <span class="special">=</span> <a class="link" href="permissions.html" title="Class permissions">permissions</a><span class="special">(</span><span class="special">)</span><span class="special">)</span><span class="special">;</span></pre>
<p>Creates shared memory and creates and places the segment manager if segment was not created. If segment was created it connects to the segment. This can throw. </p>
</li>
<li class="listitem">
<pre class="literallayout"><a name="idm27530-bb"></a><span class="identifier">basic_managed_xsi_shared_memory</span><span class="special">(</span><a class="link" href="open_read_only_t.html" title="Struct open_read_only_t">open_read_only_t</a><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="xsi_key.html" title="Class xsi_key">xsi_key</a> <span class="special">&amp;</span> key<span class="special">,</span> 
                                <span class="keyword">const</span> <span class="keyword">void</span> <span class="special">*</span> addr <span class="special">=</span> <span class="number">0</span><span class="special">)</span><span class="special">;</span></pre>
<p>Connects to a created shared memory and its segment manager. in read-only mode. This can throw. </p>
</li>
<li class="listitem">
<pre class="literallayout"><a name="idm27542-bb"></a><span class="identifier">basic_managed_xsi_shared_memory</span><span class="special">(</span><a class="link" href="open_only_t.html" title="Struct open_only_t">open_only_t</a><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="xsi_key.html" title="Class xsi_key">xsi_key</a> <span class="special">&amp;</span> key<span class="special">,</span> 
                                <span class="keyword">const</span> <span class="keyword">void</span> <span class="special">*</span> addr <span class="special">=</span> <span class="number">0</span><span class="special">)</span><span class="special">;</span></pre>
<p>Connects to a created shared memory and its segment manager. This can throw. </p>
</li>
<li class="listitem">
<pre class="literallayout"><a name="idm27554-bb"></a><span class="identifier">basic_managed_xsi_shared_memory</span><span class="special">(</span><a class="link" href="basic_managed_xsi_idm27466.html" title="Class template basic_managed_xsi_shared_memory">basic_managed_xsi_shared_memory</a> <span class="special">&amp;&amp;</span> moved<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p>Moves the ownership of "moved"'s managed memory to *this. Does not throw </p>
</li>
<li class="listitem">
<pre class="literallayout"><a class="link" href="basic_managed_xsi_idm27466.html" title="Class template basic_managed_xsi_shared_memory">basic_managed_xsi_shared_memory</a> <span class="special">&amp;</span> 
<a name="idm27560-bb"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><a class="link" href="basic_managed_xsi_idm27466.html" title="Class template basic_managed_xsi_shared_memory">basic_managed_xsi_shared_memory</a> <span class="special">&amp;&amp;</span> moved<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p>Moves the ownership of "moved"'s managed memory to *this. Does not throw </p>
</li>
<li class="listitem">
<pre class="literallayout"><a name="idm27486-bb"></a><span class="special">~</span><span class="identifier">basic_managed_xsi_shared_memory</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<p>Destroys *this and indicates that the calling process is finished using the resource. The destructor function will deallocate any system resources allocated by the system for use by this process for this resource. The resource can still be opened again calling the open constructor overload. To erase the resource from the system use remove(). </p>
</li>
</ol></div>
</div>
<div class="refsect2">
<a name="id-1.3.19.17.3.40.3.4.4"></a><h3>
<a name="idm27476-bb"></a><code class="computeroutput">basic_managed_xsi_shared_memory</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="idm27477-bb"></a><span class="identifier">swap</span><span class="special">(</span><a class="link" href="basic_managed_xsi_idm27466.html" title="Class template basic_managed_xsi_shared_memory">basic_managed_xsi_shared_memory</a> <span class="special">&amp;</span> other<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
<p>Swaps the ownership of the managed shared memories managed by *this and other. Never throws. </p>
</li>
<li class="listitem"><pre class="literallayout"><span class="keyword">int</span> <a name="idm27484-bb"></a><span class="identifier">get_shmid</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre></li>
</ol></div>
</div>
<div class="refsect2">
<a name="id-1.3.19.17.3.40.3.4.5"></a><h3>
<a name="idm27568-bb"></a><code class="computeroutput">basic_managed_xsi_shared_memory</code> public static functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
<pre class="literallayout"><span class="keyword">static</span> <span class="keyword">bool</span> <a name="idm27569-bb"></a><span class="identifier">remove</span><span class="special">(</span><span class="keyword">int</span> shmid<span class="special">)</span><span class="special">;</span></pre>
<p>Erases a XSI shared memory object identified by shmid from the system. Returns false on error. Never throws </p>
</li></ol></div>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
<td align="right"><div class="copyright-footer">Copyright © 2005-2015 Ion Gaztanaga<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
      </p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="wmanaged_windows__idm27454.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../interprocess/indexes_reference.html#header.boost.interprocess.managed_xsi_shared_memory_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="managed_xsi_shared_memory.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
